<?php
require('config.php');
		$start=0;
		$num=10;
		$type=0;
		$time=time();
		if(isset($_REQUEST['start'])) $start=$_REQUEST['start'];
		if(isset($_REQUEST['num'])) $num=$_REQUEST['num'];
		if(isset($_REQUEST['type'])) $type=$_REQUEST['type'];
		if($type==0 || $type=='0')
		{
			$sql="select i.goodsId,i.goodsName,i.goodsDesc,i.goodsImg from `".$oto."_integral` as i where `goodsFlag`='1' and `isSale`='1' and goodsStock>0 order by createTime DESC LIMIT $start,$num";
		}
		else
		{
			$sql="select i.goodsId,i.goodsName,i.goodsDesc,i.goodsImg from `".$oto."_integral` as i where `goodsFlag`='1' and `isSale`='1' and goodsStock>0 and `integralType`='1' and i.endTime>$time order by createTime DESC LIMIT $start,$num";
		}
		//file_put_contents("tsxx.txt", "\r\n查询分页商品".$sql."\r\n", FILE_APPEND);
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$jf_goods_list[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($jf_goods_list)) echo json_encode($jf_goods_list);
		else echo '[]';
?>